<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>登录</title>
    <meta http-equiv="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="/static/pc/login.css" type="text/css">
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/jquery.form.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="/static/pc/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <style>

        .login-area {
            padding-left: 0px; width:450px;float: left;padding-top: 100px;}

    </style>
</head>

<body class="regs">
<div class="customer-header">
    <div class="setout bit-ti-s po-re" style="width:1200px;">
        <div style="float: left;">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td><a href="/web/index/index.html"><img src="/static/pc/image/logo.jpg" alt="logo" style="width: 250px;"></a></td>
            </tr> <tr>
            <td class="pa-le-5" style="width: 700px;"><img src="/static/pc/image/banner.jpg" style="width: 600px;"  /></td>
        </tr>
        </table>
        </div>


        <div class="login-area"  >
            <div style="border: 1px #ccc solid;padding-left: 35px;margin-top:50px;padding-bottom: 20px;width: 350px;">
            <div class="wel-log" style="padding-top: 60px;text-align: center;">
                <h3><span>欢迎登录</span></h3>
            </div>
            <form action="" method="post" name="login" id="login">
                <div class="login-x">
                    <div class="ma-to--26">
                        <table class="pa-10-0" width="100%" border="0" cellspacing="0" cellpadding="0">



                            <tr>
                                <td>帐号:</td>
                                <td><input class="zc-text" type="text" id="username" name="username" placeholder="帐号"/></td>
                            </tr>
                            <tr><td>密码:</td>
                                <td><input class="zc-text" name="password" id="password" type="password" placeholder="密码"/></td>
                            </tr>

                            <tr>
                                <td></td>
                                <td><button type="submit" class="login" value="登录">登录</button></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </form>

            <p class="nu-miaf">没有账号？&nbsp;&nbsp;<a href="{:url('user_reg')}" style="padding-right: 20px;">个人注册</a><a  href="{:url('instit_reg')}">机构申请入驻</a></p>


            </div>
        </div>


    </div>
</div>
<div class="setout" >

</div>
<script type="text/javascript">



    $(function(){
        $('#login').ajaxForm({
            beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
            success: complete, // 这是提交后的方法
            dataType: 'json'
        });

        function checkForm(){

            if( '' == $.trim($('#username').val())){
                layer.msg('帐号不能为空', {icon: 5,time:1500,shade: 0.2}, function(index){
                    layer.close(index);
                });
                return false;
            }
            if( '' == $.trim($('#password').val())){
                layer.msg('密码不能为空', {icon: 5,time:1500,shade: 0.2}, function(index){
                    layer.close(index);
                });
                return false;
            }

        }

        function complete(data){

            console.log(data);

            if(data.code == 1){
                window.location.href="{:url('index/index')}";
            }else{
                layer.msg(data.msg, {icon: 5,time:1500,shade: 0.2}, function(index){
                    layer.close(index);
                });
                return false;
            }
        }

    });
</script>
</body>
</html>